package com.hqd.ch03.v50.beans.factory.parsing;

import com.hqd.ch03.v50.io.Resource;

public class Location {

    private final Resource resource;


    private final Object source;


    /**
     * Create a new instance of the {@link Location} class.
     *
     * @param resource the resource with which this location is associated
     */
    public Location(Resource resource) {
        this(resource, null);
    }

    /**
     * Create a new instance of the {@link Location} class.
     *
     * @param resource the resource with which this location is associated
     * @param source   the actual location within the associated resource
     *                 (may be {@code null})
     */
    public Location(Resource resource, Object source) {
        this.resource = resource;
        this.source = source;
    }


    /**
     * Get the resource with which this location is associated.
     */
    public Resource getResource() {
        return this.resource;
    }

    public Object getSource() {
        return this.source;
    }

}

